<?php  
   if(isset($_GET['cat_id']))
   {
      $id_super = $_GET['cat_id'];      
   }
   else if(isset($_GET['cat_p']))
   {
      $id_super = $_GET['cat_p'];
   }
   else
   {
     $id_super = '';
   }
   if(isset($_GET['cat_p']))
   {
      $cat_p = $_GET['cat_p'];
   }
   
   if(isset($_GET['cat_id']))
   {
   $catid = "&amp;cat_id=".$_GET['cat_id'];
   }
   else
   {
     $catid ='' ;
   }

    $str_sele_color="SELECT DISTINCT brand.`brand_id`, brand.`brand_name` FROM tblcategory AS cate 
         INNER JOIN tblproduct_in_category AS com ON cate.id=com.category_id 
         INNER JOIN tbl_color_size AS mix ON com.product_id=mix.pid 
         INNER JOIN tbl_brand AS brand ON brand.`brand_name`=mix.`brand_name`
         WHERE cate.parent_id='".$id_super."'";
    $query_sel_color=mysql_query($str_sele_color);
?>
<style>
   a.mix_s_c
   {float: left; width: 40px; border:1px solid #eee;display: block;padding:5px; text-align: center;
   margin: 0 3px 3px 0;width: 10px;height: 10px;
   }
   a.mix_s_c:hover{
      background:orange;
      color:#fff;
      border-color: burlywood;
      
   }
</style>
	<?php if(mysql_num_rows($query_sel_color)>0){ ?>
<div style="width:90%; background-color:#EAEDEE; border:1px solid #eee; padding: 10px; max-height: 176px; text-align: center;"><b>Brand Name</b></div>
<div style="width:90%;  border:1px solid #eee; padding: 10px; max-height: 176px; overflow-y: auto;">
   
   <table style="width:100%">
    <?php
      while($sel_result_color=mysql_fetch_array($query_sel_color)){  
     ?> 
      <tr>
    <td style="width:90px;">
       <input type="checkbox" name="txcheck" value=""/>
    </td>  
    <td><a href="<?php echo W_ROOT;?>/product/?cat_p=<?php echo $cat_p?><?php echo $catid;?>&brand=<?php echo $sel_result_color['brand_name']  ?>"><?php echo $sel_result_color['brand_name'] ?></a></td> 
    </tr>
 <?php }?>
      </table>
</div>  
<?php } ?>